﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;

namespace Entity
{
   public class Advertise
    {
       public string Id { get; set; }
       public string Name { get; set; }
       public string Image { get; set; }
       public string Width { get; set; }
       public string Height { get; set; }
       public string Link { get; set; }
       public string Target { get; set; }
       public string Content { get; set; }
       public string Position { get; set; }
       public string PageId { get; set; }
       public string Click { get; set; }
       public string Ord { get; set; }
       public string Active { get; set; }
       public string Lang { get; set; }
       public static Advertise AdvertiseIDataReader(IDataReader dr)
       {
           var obj = new Advertise
                         {
                             //(dr["Id"] is DBNull) ? string.Empty : dr["Id"].ToString(),
                             Name = (dr["Name"] is DBNull) ? string.Empty : dr["Name"].ToString(),
                             Image = (dr["Image"] is DBNull) ? string.Empty : dr["Image"].ToString(),
                             Width = (dr["Width"] is DBNull) ? string.Empty : dr["Width"].ToString(),
                             Height = (dr["Height"] is DBNull) ? string.Empty : dr["Height"].ToString(),
                             Link = (dr["Link"] is DBNull) ? string.Empty : dr["Link"].ToString(),
                             Target = (dr["Target"] is DBNull) ? string.Empty : dr["Target"].ToString(),
                             Content = (dr["Content"] is DBNull) ? string.Empty : dr["Content"].ToString(),
                             Position = (dr["Position"] is DBNull) ? string.Empty : dr["Position"].ToString(),
                             PageId = (dr["PageId"] is DBNull) ? string.Empty : dr["PageId"].ToString(),
                             Click = (dr["Click"] is DBNull) ? string.Empty : dr["Click"].ToString(),
                             Ord = (dr["Ord"] is DBNull) ? string.Empty : dr["Ord"].ToString(),
                             Active = (dr["Active"] is DBNull) ? string.Empty : dr["Active"].ToString(),
                             Lang = (dr["Lang"] is DBNull) ? string.Empty : dr["Lang"].ToString(),
                             Id = Convert.ToString(dr["Id"])
                         };
           return obj;
       }
    }
}
